home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13790 < prev    next >
Encoding:
Text File  |  1996-08-05  |  740 b   |  23 lines

  1. Newsgroups: comp.lang.c
  2. Path: netcom.com!berliner
  3. From: berliner@netcom.com (Guy Berliner)
  4. Subject: Formatted print with variable output field width.
  5. Message-ID: <berlinerDpMBoE.AEn@netcom.com>
  6. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  7. Date: Tue, 9 Apr 1996 23:24:14 GMT
  8. Sender: berliner@netcom23.netcom.com
  9.  
  10. Does anyone know of a way of creating a variable output field width?
  11. Say, for example, I wish to have a width of v+3, where v is some
  12. integer, the result of some calculation. Is there some way to say
  13. something like
  14.  
  15.       printf("%<v+3>.<v>f", floatingnum);
  16.  
  17. where the result of the evaluation of v+3 and of v will be
  18. fed to printf?
  19.  
  20. Guy Berliner
  21. -- 
  22. Finger berliner@netcom18.netcom.com for pgp key.
  23.